#include "stdafx.h"
#include <serialization/ioParamStructs.h>
#include <serialization/serialization.h>
#include <winsock/winsock_stub.h>

void connect_stub (
    __in std::vector<char>& in_buf,
    __in std::vector<char>& out_buf
    )
{
//RECEIVE()
    Deserialize deserialize (in_buf);
    connect_in_inout connectIN;
    deserialize (connectIN);

    int ret = connect (connectIN.s_, connectIN.addr_, connectIN.addrlen_);
//SEND
    connect_out_inout connectOUT( (ret == 0) ? 0 : WSAGetLastError() );
    
    Serialize(deserialize.get_header(), connectOUT, out_buf);
}
